package org.viettan.android.main.model;

import android.net.Uri;

import com.google.common.base.Preconditions;

/**
 * Represents an ongoing Viet Tan campaign.
 */
@SuppressWarnings("serial")
public class Campaign implements Entity {

    private int id;
    private String title;
    private Uri imageSmallUrl;
    private Uri imageLargeUrl;

    /**
     * Constructs a new {@code Campaign}
     */
    public Campaign() {
    }

    /**
     * Sets the ID of the campaign.
     *
     * @param id
     * @return
     */
    public Campaign setId(int id) {
	Preconditions.checkArgument(id > 0, "Id must be positive");

	this.id = id;
	return this;
    }

    /**
     * Returns the ID of the campaign.
     */
    public int getId() {
	return id;
    }

    /**
     * Sets the title of the campaign.
     *
     * @param title
     * @return
     */
    public Campaign setTitle(String title) {
	this.title = title;
	return this;
    }

    /**
     * Returns the title of the campaign.
     */
    public String getTitle() {
	return title;
    }

    /**
     * Sets the URL to the small image of this campaign.
     *
     * @param imageSmallUrl
     * @return
     */
    public Campaign setTitle(Uri imageSmallUrl) {
	this.imageSmallUrl = imageSmallUrl;
	return this;
    }

    /**
     * Sets the URL to the small image of this campaign.
     *
     * @param imageSmallUrl
     * @return
     */
    public Campaign setImageSmallUrl(Uri imageSmallUrl) {
	this.imageSmallUrl = imageSmallUrl;
	return this;
    }

    /**
     * Returns the URL to the small image of this campaign.
     */
    public Uri getImageSmallUrl() {
	return imageSmallUrl;
    }

    /**
     * Sets the URL to the large image of this campaign.
     *
     * @param imageLargeUrl
     * @return
     */
    public Campaign setImageLargeUrl(Uri imageLargeUrl) {
	this.imageLargeUrl = imageLargeUrl;
	return this;
    }

    /**
     * Returns the URL to the large image of this campaign.
     */
    public Uri getImageLargeUrl() {
	return imageLargeUrl;
    }

    @Override
    public String toString() {
	return title;
    }
}
